<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>getn_wstr</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_002_001_419">&nbsp;</a>NAME</h4><blockquote>
getn_wstr, get_wstr, mvgetn_wstr, mvget_wstr, mvwgetn_wstr, mvwget_wstr,
wgetn_wstr, wget_wstr
- get an array of wide characters and function key codes from a terminal
</blockquote><h4><a name = "tag_002_001_420">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

int getn_wstr(wchar_t *<i>wstr</i>, int <i>n</i>);

int get_wstr(wchar_t *<i>wstr</i>);

int mvgetn_wstr(int <i>y</i>, int <i>x</i>, wchar_t *<i>wstr</i>, int <i>n</i>);

int mvget_wstr(int <i>y</i>, int <i>x</i>, wchar_t *<i>wstr</i>);

int mvwgetn_wstr(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>, wchar_t *<i>wstr</i>, int <i>n</i>);

int mvwget_wstr(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>, wchar_t *<i>wstr</i>);

int wgetn_wstr(WINDOW *<i>win</i>, wchar_t *<i>wstr</i>, int <i>n</i>);

int wget_wstr(WINDOW *<i>win</i>, wchar_t *<i>wstr</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_002_001_421">&nbsp;</a>DESCRIPTION</h4><blockquote>
The effect of
<i>get_wstr()</i>
is as though a series of calls to
<i><a href="get_wch.html">get_wch()</a></i>
were made, until a newline character, end-of-line character, or end-of-file
character is processed.
An end-of-file character is represented by WEOF, as defined in
<i><a href="../xsh/wchar.h.html">&lt;wchar.h&gt;</a></i>.
A newline or end-of-line is represented as its
<b>wchar_t</b>
value.  In all instances, the end of the string is terminated by a null
<b>wchar_t</b>.
The resulting values are placed in the area pointed to by <i>wstr</i>.
<p>
The user's erase and kill characters are interpreted and affect the sequence
of characters returned.
<p>
The effect of
<i>wget_wstr()</i>
is as though a series of calls to
<i><a href="wget_wch.html">wget_wch()</a></i>
were made.
<p>
The effect of
<i>mvget_wstr()</i>
is as though a call to
<i><a href="move.html">move()</a></i>
and then a series of calls to
<i><a href="get_wch.html">get_wch()</a></i>
were made.  The effect of
<i>mvwget_wstr()</i>
is as though a call to
<i><a href="wmove.html">wmove()</a></i>
and then a series of calls to
<i><a href="wget_wch.html">wget_wch()</a></i>
were made.  The effect of
<i>mvgetn_wstr()</i>
is as though a call to
<i><a href="move.html">move()</a></i>
and then a series of calls to
<i><a href="get_wch.html">get_wch()</a></i>
were made.  The effect of
<i>mvwgetn_wstr()</i>
is as though a call to
<i><a href="wmove.html">wmove()</a></i>
and then a series of calls to
<i><a href="wget_wch.html">wget_wch()</a></i>
were made.
<p>
The
<i>getn_wstr()</i>,
<i>mvgetn_wstr()</i>,
<i>mvwgetn_wstr()</i>
and
<i>wgetn_wstr()</i>
functions read at most <i>n</i> characters, letting the application prevent
overflow of the input buffer.
</blockquote><h4><a name = "tag_002_001_422">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, these functions return OK.
Otherwise, they return ERR.
</blockquote><h4><a name = "tag_002_001_423">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_002_001_424">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
Reading a line that overflows the array pointed to by <i>wstr</i> with
<i>get_wstr()</i>,
<i>mvget_wstr()</i>,
<i>mvwget_wstr()</i>
or
<i>wget_wstr()</i>
causes undefined results.  The use of
<i>getn_wstr()</i>,
<i>mvgetn_wstr()</i>,
<i>mvwgetn_wstr()</i>
or
<i>wgetn_wstr()</i>,
respectively, is recommended.
<p>
These functions cannot return KEY_ values as there is no way
to distinguish a KEY_ value from a valid
<b>wchar_t</b>
value.
</blockquote><h4><a name = "tag_002_001_425">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="get_wch.html">get_wch()</a></i>,
<i><a href="getstr.html">getstr()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>,
<i><a href="../xsh/wchar.h.html">&lt;wchar.h&gt;</a></i>
(in the <b>XSH</b> specification),
<b>XBD</b> specification, <a href="../xbd/termios.html"><b>General Terminal Interface</b>&nbsp;</a> .
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
